import java.awt.Color;

import org.newdawn.slick.SlickException;
import org.newdawn.slick.UnicodeFont;
import org.newdawn.slick.font.effects.ColorEffect;
/**
 * 
 * @author http://www.google.com/codesearch#YVoT7EHH6Ms/trunk/src/com/drakulo/hi/gfx/FontFactory.java&q=font%20package:http://heroes-inn%5C.googlecode%5C.com&type=cs
 *
 */
public class FontFactory {
	public static final String ARIAL = "lib/fonts/arial.ttf"; //New Location

	private static UnicodeFont visitor_10_white;
	private static UnicodeFont visitor_10_black;
	private static UnicodeFont arial_16_black;
	private static UnicodeFont arial_25_black;
	private static UnicodeFont arial_25_white;

	private static UnicodeFont menuButtonFont;
	private static UnicodeFont menuButtonFontHover;
	private static UnicodeFont gaugeFont;

	private static UnicodeFont getArial(int size) throws SlickException {
		return new UnicodeFont("lib/fonts/arial.ttf", size, false, false);
	}

	@SuppressWarnings("unchecked")
	public static UnicodeFont getArial_16_black() throws SlickException {
		if (arial_16_black == null) {
			arial_16_black = getArial(16);
			arial_16_black.addAsciiGlyphs();
			arial_16_black.getEffects().add(new ColorEffect(Color.black));
			arial_16_black.loadGlyphs();
		}
		return arial_16_black;
	}

	@SuppressWarnings("unchecked")
	public static UnicodeFont getArial_25_black() throws SlickException {
		if (arial_25_black == null) {
			arial_25_black = getArial(25);
			arial_25_black.addAsciiGlyphs();
			arial_25_black.getEffects().add(new ColorEffect(Color.black));
			arial_25_black.loadGlyphs();
		}
		return arial_25_black;
	}

	@SuppressWarnings("unchecked")
	public static UnicodeFont getArial_25_white() throws SlickException {
		if (arial_25_white == null) {
			arial_25_white = getArial(25);
			arial_25_white.addAsciiGlyphs();
			arial_25_white.getEffects().add(new ColorEffect(Color.white));
			arial_25_white.loadGlyphs();
		}
		return arial_25_white;
	}

	public static UnicodeFont getDefaultFont() throws SlickException {
		return getArial_16_black();
	}

	public static UnicodeFont getDefaultTitleFont() throws SlickException {
		return getArial_25_black();
	}

	@SuppressWarnings("unchecked")
	public static UnicodeFont getGaugeFont() throws SlickException {
		if (gaugeFont == null) {
			gaugeFont = new UnicodeFont(ARIAL, 20, false, true);
			gaugeFont.addAsciiGlyphs();
			gaugeFont.getEffects().add(new ColorEffect(Color.white));
			gaugeFont.loadGlyphs();
		}
		return gaugeFont;
	}

	@SuppressWarnings("unchecked")
	public static UnicodeFont getMenuButtonFont() throws SlickException {
		if (menuButtonFont == null) {
			menuButtonFont = new UnicodeFont(ARIAL, 25, false, false);
			menuButtonFont.addAsciiGlyphs();
			menuButtonFont.getEffects().add(new ColorEffect(Color.white));
			menuButtonFont.loadGlyphs();
		}
		return menuButtonFont;
	}

	@SuppressWarnings("unchecked")
	public static UnicodeFont getMenuButtonFontHover() throws SlickException {
		if (menuButtonFontHover == null) {
			menuButtonFontHover = new UnicodeFont(ARIAL, 25, false, false);
			menuButtonFontHover.addAsciiGlyphs();
			menuButtonFontHover.getEffects().add(
					new ColorEffect(Color.lightGray));
			menuButtonFontHover.loadGlyphs();
		}
		return menuButtonFontHover;
	}

	@SuppressWarnings("unchecked")
	public static UnicodeFont getVisitor10_black() throws SlickException {
		if (visitor_10_black == null) {
			visitor_10_black = new UnicodeFont("data/fonts/visitor1.ttf", 10,
					false, false);
			visitor_10_black.addAsciiGlyphs();
			visitor_10_black.getEffects().add(new ColorEffect(Color.black));
			visitor_10_black.loadGlyphs();
		}
		return visitor_10_black;
	}

	@SuppressWarnings("unchecked")
	public static UnicodeFont getVisitor10_white() throws SlickException {
		if (visitor_10_white == null) {
			visitor_10_white = new UnicodeFont("data/fonts/visitor1.ttf", 10,
					false, false);
			visitor_10_white.addAsciiGlyphs();
			visitor_10_white.getEffects().add(new ColorEffect(Color.white));
			visitor_10_white.loadGlyphs();
		}
		return visitor_10_white;
	}
}